#include <vector>

#include "row.h"
#include "data_models.h"
#include "util.h"
#include "file_type.h"


class Document{
public:

    Document();
    ~Document();

    std::string* FileName=NULL;

    int Open(char*);
    int Save();
    Row* GetRowByIndex(int index);
    bool IsEmpty();
    int Len();
    void Insert(Position,char);
    void Delete(Position at);
    void InsertNewLine(Position at);
    bool IsDirty();
    Position Find(std::string str,Position after,SearchDirection direction);
    void Highlight(std::string word);
    void Highlight(std::string word,int until);
    std::string GetFileType();
    void UnhighlightRows(int start);

private:
    std::vector<Row*> _rows;
    bool _dirty=false;
    FileType _fileType;
};
